package com.zqh.volatileDemo;

/**
 * @author 曾庆红
 * {@code @date} 2023-10-12 10:01
 * 单例模式设计
 */

public class Mgr {
    private static volatile Mgr INSTANCE;
    private Mgr(){}
    public static Mgr getInstance(){
        if(INSTANCE == null){
            synchronized (Mgr.class){
                INSTANCE = new Mgr();
            }
        }
        return INSTANCE;
    }
}
